class Solution:
  def findNumberIn2DArray(self, matrix: list, target: int) -> bool:
    for row in range(len(matrix)):
      for col in range(len(matrix[0])):
        if matrix[row][col] == target:
          return True
    return False


'''
STATUS: SOLVED
TRIES:  1
TIME:   56 MS
MEMORY: 17.9 MB
'''
if __name__ == "__main__":
  solution = Solution()
  matrix = [
    [1, 4, 7, 11, 15], 
    [2, 5, 8, 12, 19], 
    [3, 6, 9, 16, 22],
    [10, 13, 14, 17, 24], 
    [18, 21, 23, 26, 30]
  ]
  target = 20
  print(solution.findNumberIn2DArray(matrix, target))
